package com.hioove.core.container;

import com.hioove.core.filter.FilterChain;
import com.hioove.core.model.base.config.ConfigInfor;
import com.hioove.core.model.base.config.MethodSupport;
import com.hioove.core.model.base.config.StartClassInfo;
import com.hioove.core.util.ClassUtils;

import java.util.HashMap;

/**
 * 中间件 接口
 */
public interface IContainer {

    IContainer INSTANCE = getInstance();

    String NETTY = "com.hioove.core.container.NettyContainer";

    IContainer setStartupParam(StartClassInfo StartupParam);

    IContainer setConfigInfo(ConfigInfor ConfigInfo);

    IContainer setDispatch(HashMap<String, MethodSupport> Dispatch);

    IContainer setFilter(FilterChain Filter);

    static IContainer getInstance() {
        return ClassUtils.createObj(NETTY);
    }

    abstract Object start() ;

}
